package cn.laixueit.mapper;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

/**
 * @author duxiang
 * @date 2023/12/1 16:55
 */

public interface CodeMapper {
    @Select("select ${fieldName} from ${tableName} where ${fieldName} like CONCAT(DATE_FORMAT(NOW(),'%Y%m%d'),'%') order by `code` desc LIMIT 1 ")
    String getCode(@Param("fieldName")String fieldName,@Param("tableName")String tableName);
}
